//文件上传服务层
app.service("uploadService",function ($http) {
    this.uploadFile=function () {
        var formData = new FormData();
        formData.append("file",file.files[0]);
        return $http(
            {
                method:'POST',
                url:"../upload.do",
                data: formData,
                headers: {'Content-Type':undefined},   //必须设置，否则上传异常
                transformRequest: angular.identity
            }
        );
    }
})